//
//  FreeNewProductCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/10/21.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "FreeNewProductCell.h"

@implementation FreeNewProductCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.backgroundColor =  UIColorHex(0xF54741);
    self.backgroundColor =  UIColorHex(0xF54741);

}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self.handleBtn pp_clipCorners:UIRectCornerAllCorners radius:self.handleBtn.frame.size.height/2];
        [self.bgView pp_clipCorners:UIRectCornerAllCorners radius:6];
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:6];

    });
}

- (void)fillCellWithModel:(CommonPackageModel *)model {
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.fangUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    
    self.mainTitleLab.text = model.goodsName;
    
//    if ([TTUserModel sharedObject].token.length > 0) {
        self.subTitleLab.text = [NSString stringWithFormat:@"价格：¥%@",[Utilities changeDoubleToString:model.goodsActivePrice]];
//    } else {
//        self.subTitleLab.text = @"登录后查看补贴价";
//    }
}

@end
